package com.xh.provider.service.impl;

import api.xh.domain.User;
import com.xh.api.IUserService;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * @Name UserServiceImpl
 * @Description
 * @Author wen
 * @Date 2019-11-08
 */
@Service
public class UserServiceImpl implements IUserService{

    private List<User> userList = Arrays.asList(
            //幻码
            new User(1L, "张三"),
            new User(2L, "李四"),
            new User(3L, "王五"),
            User.builder().id(1L).name("武汉话").build()
    );

    @Override
    public User findById(Long id) {
        return userList.get(id.intValue());
    }

    @Override
    public List<User> findAll() {
        return userList;
    }

}
